#ifndef DSPINNER_H
#define DSPINNER_H

#include "devcommon_global.h"

#include <QScopedPointer>
#include <QWidget>


class DSpinnerPrivate;
class DEVCOMMONSHARED_EXPORT DSpinner : public QWidget
{
    Q_OBJECT
public:
    explicit DSpinner(QWidget *parent = 0);
    ~DSpinner();

    bool isPlaying() const;

public Q_SLOTS:
    void start();
    void stop();
    void setBackgroundColor(QColor color);

protected:
    void paintEvent(QPaintEvent *) override;
    void changeEvent(QEvent *e) override;

private slots:
    void onRefreshTimer();
private:
    DSpinnerPrivate* d_ptr;
    Q_DECLARE_PRIVATE(DSpinner)
};

#endif
